const qwer = document.querySelector('.int')
const box = document.querySelector('.w1')

qwer.oninput = function () {
    const text = this.value
    const script = document.createElement('script')
    script.src = 'https://www.baidu.com/sugrec?pre=1&p=3&ie=utf-8&json=1&prod=pc&from=pc_web&sugsid=34099,33970,34004,33855,33607,26350,22159&wd=' + text + '&req=2&csor=5&pwd=aiqiyi&cb=fn&_=1623047595324'
    document.body.appendChild(script)
    script.remove()
}
function fn(res) {
    if (!res.a) {
        box.style.display = 'none'
        return
    }
    let str = ''
    res.a.forEach(item => {
        str += `<li>${item.q}</li>`
    })
    box.innerHTML = str
    box.style.display = 'block'
}